package com.hxd.mall.injector.components

import android.app.Application
import com.hxd.mall.application.HxdApplication
import com.hxd.mall.injector.modules.ActivityBindingModule
import com.hxd.mall.injector.modules.ApplicationModule
import dagger.BindsInstance
import dagger.Component
import dagger.android.AndroidInjector
import dagger.android.support.AndroidSupportInjectionModule
import javax.inject.Singleton

/**
 * app组件类,谁需要谁依赖
 *
 * 例如： @Component(dependencies = [ApplicationComponent::class], modules = [LoginModule::class])
 *
 * Created by qishuai on 2018/7/29.
 */
@Singleton
@Component(
    modules = [
        ApplicationModule::class,
        ActivityBindingModule::class,
        AndroidSupportInjectionModule::class]
    //OkHttpModule::class,
    //RetrofitModule::class,
    //MainServiceModule::class]
)
interface ApplicationComponent : AndroidInjector<HxdApplication> {
    /*// 上下文
    fun getContext(): Context

    // 网络模块
    fun getMainFunctionApi(): IMeFunctionApi

    // 网络模块-账户管理
    fun getAccountFunctionApi(): IAccountFunctionApi

    // 网络模块-借款模块
    fun getBorrowMoneyFunctionApi(): IConfigureFunctionApi

    //共用模块
//    fun getCommonFunctionApi():ManagerFunctionApi*/


    @Component.Builder
    interface Builder {

        @BindsInstance
        fun application(application: Application): Builder

        fun build(): ApplicationComponent
    }
}